(display "\n========================================\n")
(define (add-interval x y)
    (make-interval (+ (lower-bound x) (lower-bound y))
                   (+ (upper-bound x) (upper-bound y))))

(define (mul-interval x y)
    (let ((p1 (* (lower-bound x) (lower-bound y)))
          (p2 (* (lower-bound x) (upper-bound y)))
          (p3 (* (upper-bound x) (lower-bound y)))
          (p4 (* (upper-bound x) (upper-bound y))))
         (make-interval (min p1 p2 p3 p4)
                        (max p1 p2 p3 p4))))

(define (div-interval x y)
    (mul-interval x
                  (make-interval (/ 1 (lower-bound y))
                                 (/ 1 (upper-bound y)))))

(define (make-center-width c w)
    (make-interval (- c w) (+ c w)))

(define (center i)
    (/ (+ (lower-bound i) (upper-bound i)) 2))

(define (width i)
    (/ (- (upper-bound i) (lower-bound i)) 2))


(define (make-center-percent c p)
    (make-interval (- c (* c p)) (+ c (* c p))))

(define (percent i)
    (/ (width i) (center i)))

(define (make-interval a b) (cons a b))
(define (lower-bound z) (car z))
(define (upper-bound z) (cdr z))

(define v1 (make-interval 1 2))
(define v2 (make-interval 3 4))

(display (center v1))
(newline)
(display (width v1))
(newline)
(display (percent v1))
(newline)
(display (percent v2))
(display "\n========================================\n")
